﻿using Castle.DynamicProxy;

namespace In66.Net.Share.Application.Interceptor.SqlSugarUnitOfWork
{
    /// <summary>
    /// 工作单元拦截器
    /// </summary>
    public class SqlSugarUowInterceptor : IInterceptor
    {
        private readonly SqlSugarUowAsyncInterceptor _uowAsyncInterceptor;

        public SqlSugarUowInterceptor(SqlSugarUowAsyncInterceptor uowAsyncInterceptor)
        {
            _uowAsyncInterceptor = uowAsyncInterceptor;
        }

        public void Intercept(IInvocation invocation)
        {
            _uowAsyncInterceptor.ToInterceptor().Intercept(invocation);
        }
    }
}
